Rails.application.routes.draw do
  resource :wechat, only: [:show, :create]
  resources :users, only: [:index,:show]
  resources :session, only: [:new, :create]
  resources :coupons, only: [:index,:new] do
    collection do
      post 'import'
      get 'export'
      get 'coupons_export'
      post 'list_create'
      get 'list'
      get 'hide'
      post 'destroy'
      post 'edit'
      #get 'show'
    end
  end
  get 'coupons/show', to: 'coupons#show'
  get 'coupons/total', to: 'coupons#total'
  resources :pictures, only: [:index,:new,:create,:destroy]
  delete 'session', to: 'session#destroy'
  post 'users/update', to: 'users#update'
  post 'coupons/update', to: 'coupons#update'
  root 'home#index'
  get 'admins', to: 'admins#index'
  get 'my_coupons', to: 'coupon#my_coupons'
  post 'add/coupon', to: 'coupon#add'
  get 'show', to: 'coupon#show'
  get 'receive', to: 'coupon#receive'
  get 'search', to: 'search#index'
  resources :admins, only: [:index] do
    collection do
     get 'list'
    end
  end
end
